package net.sansi.v3correctserver.dto.analyse;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;
import net.sansi.v3correctserver.entity.IntPoint;
import net.sansi.v3correctserver.service.analyse.AutoSplitArea;
import net.sansi.v3correctserver.service.camera.Camera;

import javax.validation.constraints.NotBlank;
import java.util.List;

/**
 * Created by Fang
 * create time : 2024/11/1
 * IDE : IntelliJ IDEA
 * <p>
 * 矩形屏 相片分析
 */

public class PhotoAnalyseDto {

    /**
     * 矩形屏 相片分析 请求
     */
    @Data
    @Accessors(chain = true)
    @ApiModel("矩形屏相片分析 请求 ")
    public static class RectPhotoReq {
        @ApiModelProperty("灯点照片路径（绝对路径）")
        @NotBlank()
        private String ledPath;

        @ApiModelProperty("黑灯背景照片绝对路径，没有可以留空")
        private String blackPath;

        @ApiModelProperty("手动绘制的屏幕围栏")
        private List<IntPoint> fence;
    }

    /**
     * 矩形屏 全自动分析 请求
     */
    @Data
    @Accessors(chain = true)
    @ApiModel("矩形屏自动分析 请求")
    public static class RectAutoReq {
        @ApiModelProperty("区域id")
        private Integer areaId;

        @ApiModelProperty("初始相机参数")
        private Camera.Params cameraParams;

        @ApiModelProperty("围栏")
        private List<IntPoint> fence;

        @ApiModelProperty("需要分析的颜色索引")
        private Integer colorIdx;
    }

    /**
     * 矩形屏 相片分析 请求
     * 1. 参数：相机参数，区域
     * 2. 拍摄相片
     * 3. 相片分析
     */
    @Data
    @Accessors(chain = true)
    @ApiModel("矩形屏拍照识别 请求")
    public static class RectTakeReq {
        @ApiModelProperty("相机参数")
        private Camera.Params cameraParams;

        @ApiModelProperty("区域id")
        private Integer areaId;

        @ApiModelProperty("颜色索引 0 红 1 绿 2 蓝")
        private Integer colorIdx;

        @ApiModelProperty("围栏")
        private List<IntPoint> fence;

    }

    @Data
    @Accessors(chain = true)
    @ApiModel("矩形屏围栏识别 请求")
    public static class RectFenceReq {
        @ApiModelProperty("灯点照片绝对路径")
        private String ledPath;

        @ApiModelProperty("黑屏背景绝对路径")
        private String blackPath;
    }

    @Data
    @Accessors(chain = true)
    @ApiModel("矩形屏围栏识别 响应")
    public static class RectFenceResp {
        @ApiModelProperty("灯点照片绝对路径")
        private String ledPath;

        @ApiModelProperty("黑屏背景绝对路径")
        private String blackPath;

        @ApiModelProperty("识别到的围栏坐标")
        private List<IntPoint> fence;
    }

    @Data
    @Accessors(chain = true)
    @ApiModel("矩形屏自动计算分区")
    public static class RectAutoSplitAreaReq {
        @ApiModelProperty("分区模式")
        private Integer mode = AutoSplitArea.MODE_DEFAULT;

        @ApiModelProperty("强制隔点数量， -1:由算法自动评估")
        private Integer span = -1;

        @ApiModelProperty("强制列数, -1: 由算法自动评估")
        private Integer col = -1;

        @ApiModelProperty("强制行数, -1: 由算法自动评估")
        private Integer row = -1;
    }
}
